﻿CREATE TABLE [dbo].[tblAccount] (
    [AccountID]         INT           IDENTITY (1, 1) NOT NULL,
    [CreateDate]        SMALLDATETIME NOT NULL,
    [CurrencyID]        INT           NOT NULL,
	[AccountNumber]		varbinary(128) null,
    [CardExpiration]    char(7) NULL,
    [BankRoutingNumber] NVARCHAR (40) NULL,
	[Checksum]			int			null,
    [OwnerID]           INT           NULL,
    [AddressID]         INT           NULL,
    [PersonID]          INT           NULL
);

GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Provides a searchable table for credit cand and bank accoun tnumbers.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The date the account record was created', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'CreateDate';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Refers to the codeCurrency table.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'CurrencyID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The CC or bank account number.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'AccountNumber';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The CC expiration date in MMyy format.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'CardExpiration';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The bank routing number.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'BankRoutingNumber';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A checksum number for the card number or bank account number.  This is used in searching for an account.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'Checksum';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Refers to the tblOwner table.  The owner company responsible for this account.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'OwnerID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Refers to the tblPerson table.  The person related to this account', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'PersonID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A reference to the tblAddress table.  The address related to this account', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblAccount',
	@level2type = N'COLUMN', @level2name = N'AddressID';
GO;
